package com.ciwong.epaper.modules.epaper.dao;

import com.ciwong.epaper.application.EApplication;
import com.ciwong.mobilelib.utils.EAction;


/**
 * 电子报 相关Action
 *
 * @author bin
 * @version ciwong v.1.0 2015/7/23 19:55
 * @since ciwong v.1.0
 */
public class EpaperAction extends EAction {
    /**
     * 根据服务ID获取书籍
     */
    public static final String ACTION_GET_EPAGE_ADVISOR = HOST
            + "/v5/service/v2/get_epage_advisor";
    /**
     * 根据服务ID获取书籍
     */
    public static final String ACTION_GET_SERVICE_BOOKS = HOST
            + "/v5/service/v2/get_service_products_by_id";
    /**
     * 获取书籍目录
     */
    public static final String ACTION_BOOK_CATALOGUES = HOST
            + "/v2/package/catalogues_package";

    public static final String ACTION_BOOK_DESK_CATALOGUES = HOST
            + "/v2/package/userdesk_catalogue";
    /**
     * 获取书籍目录资源
     */
    public static final String ACTION_CATALOGUES_RESOURCE = HOST
            + "/v2/package/book_resources_v2";

    /**
     * 获取书籍报听写目录资源
     */
    public static final String ACTION_CATALOGUES_RESOURCE_DICTATION = HOST
            + "/v2/package/book_resources_dictation";
    /**
     * 首页获取单元同步教材目录资源接口
     */
    public static final String ACTION_CATALOGUES_RESOURCE_FORMDESK = HOST
            + "/v2/package/userdesk_catalogue_content";


    /**
     * 获取我的作业列表
     */
    public static final String ACTION_GET_MY_WORK = HOST
            + "/v2/studentWork/getUserWorks";
//            + getV1OrV2();
    /**
     * 获取我的作业列表（pad版）
     */
    public static final String ACTION_GET_MY_WORK_PAD = HOST
            + "/v1/studentWork/getUserWorks";

    /**
     * 获取课堂作业列表
     */
    public static final String ACTION_GET_USER_CLASS_WORKS = HOST
            + "/v2/studentWork/getUserClassWorks";


    /**
     * 获取我的错题作业列表
     */
    public static final String ACTION_GET_MY_ERROR_WORK = HOST
            + "/v2/studentWork/getUserErrorWorks";

    private static String getV1OrV2() {
        String urlHomeworks = "/v2/studentWork/getUserWorks";
        if (isPad()) {
            urlHomeworks = "/v1/studentWork/getUserWorks";
        }
        return urlHomeworks;
    }

    /**
     * 获取我的成绩
     */
    public static final String ACTION_GET_MY_GRADE = HOST

            + "/v2/studentWork/userDoWorkReport";///h5/v2/studentWork/userDoWorkReport

    /**
     * 获取活动广告信息
     */
    public static final String ACTION_GET_ADVERT = HOST + "/v5/entry/get_theme_list";

    /**
     * 学生根据考生用书ID获取布置作业章节记录
     */
    public static final String ACTION_GET_BOOKCHAPTERS = HOST + "/v5/epaperwork/getReceiveBookchapters";


    /**
     * 作业通知回执
     */
    public static final String ACTION_GET_SET_READ = HOST
            + "/v1/studentWork/setEWorkReadStatus";

    /**
     * 获取章节目录信息以及下载地址
     */
    public static final String ACTION_GET_CATALOGUE_INFO = HOST
            + "/v1/package/catalogue_info";
    /**
     * 获取章节目录信息以及下载地址(离线包拆分新接口)
     */
    public static final String ACTION_GET_CATALOGUE_INFO_NEW = HOST
            + "/v2/package/catalogue_info";

    public static final String ACTION_GET_WORD_STOCK_ENGLISH = HOST
            + "/chat/api/WordStockEnglish";


    /**
     * 跟读、线上作答、视频讲解提交作业答案
     */
    public static final String ACTION_SUBMIT_WORKS = HOST
            + "/v1/ework/submitWorkSign";

    /**
     * 配音提交作业答案
     */
    public static final String ACTION_SUBMIT_VIDEO_WORKS = HOST
            + "/v1/ework/submitDubbingWorksign";

    /**
     * 跟读、线上作答、视频讲解提交作业答案
     */
    public static final String ACTION_SUBMIT_ERROR_WORKS = HOST
            + "/v1/ework/error/submitWorkSign";

    /**
     * 更新提交过的单元测试作业
     */
    public static final String ACTION_UPDATE_UNIT_TEST_WORKS = HOST
            + "/v1/epaperwork/cover_unit_test_status";


    /**
     * 根据服务ID、页码、页数获取书籍列表
     */

    public static final String ACTION_GET_BOOK_BY_SERVICEID = HOST + "/v5/service/v2/get_epage_product_by_serviceIds";

    public static final String ACTION_GET_BOOK_BY_SERVICEID_ANDKEYWORD = HOST + "/v5/service/v2/get_epage_product_by_serviceIds_new";


    public static final String ACTION_SEARCH_BOOK_AND_SERVICE = HOST + "/v5/shop/v2/get_shop_servers";

    public static final String ACTION_SEARCH_BOOK_AND_SERVICE_BY_TYPE = HOST + "/v5/shop/v2/get_shop_advservers";
    public static final String ACTION_GET_SUBJECT_LIST = HOST + "/v5/shop/v2/get_shop_headsubjects";
    /**
     * 添加书籍到书柜记录
     */
    public static final String ACTION_SET_EPAGE_BOOKCASE = HOST + "/v5/service/v2/set_epage_user_bookcase";
    /**
     * 说明:[APP]根据ID获取做作业详情  查询分数
     */
    public static final String ACTION_GET_SCORE_OF_ONLINE = HOST + "/v1/ework/getScore";

    /**
     * 删除书柜记录
     */
    public static final String ACTION_DEL_EPAGE_BOOKCASE = HOST + "/v5/service/v2/del_epage_user_bookcase";


    public static final String ACTION_DEL_EPAGE_BOOKCASE_LIST = HOST + "/v5/service/v2/del_epage_user_bookcase_more";


    /**
     * 取用户书柜书籍记录
     */
    public static final String ACTION_SELECT_EPAGE_BOOKCASE = HOST + "/v5/service/v2/select_epage_user_bookcase_page";

    public static final String ACTION_SELECT_EPAGE_BOOKCASE_ALL = HOST + "/v5/service/v2/select_epage_user_bookcase";

    public static final String ACTION_GET_AUTONMONIC_STUDY_BOOKS = HOST + "/v5/user/v2/get_head_lastbooks";

    public static final String ACTION_GET_ALL_PRODUCTS_BY_BOOKMARK = HOST + "/v5/user/v2/get_all_products_by_bookmark";


    public static final String ACTION_GET_ALL_PRODUCTS_BY_GET_INTERACTION_LIST = HOST + "/v1/BooksAuthor/GetInteractionList";

    public static final String ACTION_GET_STUDENT_PRODUCTS_BY_BOOKMARK = HOST + "/v5/user/v2/get_student_products_by_bookmark";
    /**
     * 按书签查询有书的年级（学生）
     */
    public static final String ACTION_GET_TEACHER_GRADE_BY_BOOKMARK = HOST + "/v5/user/v2/get_all_grade_by_bookmark";

    public static final String ACTION_GET_TEACHER_GRADE_BY_CATEGORY= HOST + "/v5/service/v2/get_book_three_category";

    public static final String ACTION_GET_TEACHER_BY_CATEGORY= HOST + "/v1/BooksAuthor/GetInteractionCategory";


    public static final String ACTION_GET_SET_HEAD_LASTBOOKS = HOST + "/v5/user/v2/set_head_lastbooks";

    public static final String ACTION_GET_USER_DESK_HEAD = HOST + "/v5/user/v2/get_user_all_desk_head";
    /**
     * 获取评分系数
     */
    public static final String ACTION_GET_SCORE_COEFFICIENT = HOST + "/v1/studentWork/scoreCoefficient";


    /**
     * 获取视频讲解和在线作答答案
     */
    public static final String ACTION_GET_VIDEO_EXPLAN_ANSWER = HOST
            + "/v5/epaperwork/getWorkAnswers";

    /**
     * 听说模考提交音频
     */
    public static final String ACTION_LSW_UPLOAD_RECORD = HOST
            + "/v1/listenfile/correct";

    /**
     * 听说模考提交订正音频
     */
    public static final String ACTION_LSW_UPLOAD_RECORRECT = HOST
            + "/v1/listenfile/recorrect";
    /**
     * 上传音频(同步批改)
     */
    public static final String ACTION_LSW_UPLOAD_ASYNC_RECORD = HOST
            + "/v2/listenfile/asynccorrect";
    /**
     * 听说模考提交作业答案
     */
    public static final String ACTION_LSW_SUBMIT_WORKS = HOST
            + "/v1/listenspeak/submitdatasign";
    /**
     * 听说模考提交作业答案(订正)
     */
    public static final String ACTION_LSW_RESUBMIT_WORKS = HOST
            + "/v1/listenspeak/reSubmitdatasign";
    /**
     * 听说模考提交错题答案
     */
    public static final String ACTION_LSW_SUBMIT_ERROR_WORKS = HOST
            + "/v1/listenspeak/error/submitdatasign";

    /**
     * 听说模考获取分数
     */
    public static final String ACTION_LSW_GET_SCORE_RESULT = HOST
            + "/v1/ework/getScore";
    /**
     * 听说模考获取分数
     */
    public static final String ACTION_ESSAY_GET_SCORE_RESULT = HOST
            + "/v1/ework/getEssayWorkScore";
    /**
     * 设置做作业进度
     */
    public static final String ACTION_LSW_DOWORK_PROGRESS = HOST
            + "/v1/epaperteacher/setDoworkProgress";

    /**
     * 服务权限判断
     */
    public static final String ACTION_CHECKVALID = HOST
            + "/v1/jfyservice/v4/checkValid";
    public static final String ACTION_GETEXAM_EXAMINATION = HOST
            + "/v1/Package/ExaminationDataForApp";

    /**
     * 获取离线包信息列表
     * 外网 https://eapi.ciwong.com/gateway/v1/repos/hybrid/haitang
     * 内网 http://eapi.jiaofucloud.cn/gateway/v1/repos/hybrid/haitang
     * /v1/repos/hybrid/haitang
     */
    public static final String ACTION_GET_ZIP_PACKAGE_LIST = HOST + getH5Update();

    public static final String ACTION_USER_SERVICES = HOST + "/v5/service/v2/get_epage_user_services";
    public static final String GET_USER_PRODUCT_BY_KEY = HOST + "/v5/user/v2/get_user_all_product_by_key";

    public static final String GET_BOOK_KEY = HOST + "/v5/service/v2/get_book_key";
    /**
     * 获取视频配音列表
     */
    public static final String ACTION_GET_DUBBING_VIDEO_LIST = HOST + "/v5/service/v2/get_dubbing_video_list";

    /**
     * 获取单个视频详情
     */
    public static final String ACTION_GET_DUBBING_VIDEO_DETAIL = HOST + "/v5/service/v2/get_dubbing_video_detail";

    /**
     * 获取视频配音记录列表
     */
    public static final String ACTION_GET_DUBBING_VIDEO_RECORD_LIST = HOST + "/v5/service/v2/get_dubbing_video_submit_records";

    /**
     * 获取音标列表
     */
    public static final String ACTION_GET_SYMBOLS_LIST = HOST + "/v5/service/v2/get_symbols_list";

    /**
     * 获取打卡作业列表
     *
     * @param action
     * @return
     */
    public static final String ACTION_GET_DK_LIST = HOST + "/v2/studentWork/getUserDkWorks";

    /**
     * 获取打卡作业列表
     *
     * @param action
     * @return
     */
    public static final String ACTION_GET_DK_DETAILS = HOST + "/v2/studentWork/getUserDkWorkDetails";

    /**
     * 提交打卡作业
     *
     * @param action
     * @return
     */
    public static final String ACTION_SUBMIT_DK_WORK = HOST + "/v1/ework/submitDkWork";

    /**
     * 提交作文作业
     *
     * @param action
     * @return
     */
    public static final String ACTION_SUBMIT_ESSAY_WORK = HOST + "/v1/ework/submitEssayWork";

    /**
     * @return
     */
    public static final String ACTION_RELATION_SEARCH_SCHOOL = HOST + "/v4/relation/school/search";

    /**
     * 查询学校列表 无需登录
     */
    public static final String ACTION_RELATION_GET_SCHOOL_LIST = HOST + "/v4/relation/school/searchSchoolList";

    /**
     * 查询配音推荐
     */
    public static final String ACTION_GET_DUB_VIDEO_RECOMMEND = HOST + "/v5/service/v2/get_dubbing_video_recommend";
    /**
     * 查询目录专辑
     */
    public static final String ACTION_GET_DUB_VIDEO_CID = HOST + "/v5/service/v2/get_dubbing_video_cId";

    /**
     * 根据名称搜索配音列表接口
     */
    public static final String ACTION_GET_DUBBING_LIST_BY_NAME = HOST + "/v5/service/v2/get_dubbing_video_list_by_name";

    /**
     * 根据cid packageId 获取配音列表
     */
    public static final String ACTION_GET_DUBBINT_LIST_BY_CID = HOST + "/v5/service/v2/get_dubbing_video_list_by_cId";


    @Override
    public String getActionUrl(String action) {
        if (action.equals(ACTION_GET_SERVICE_BOOKS)) {
            return ACTION_GET_SERVICE_BOOKS;
        } else if (action.equals(ACTION_BOOK_CATALOGUES)) {
            return ACTION_BOOK_CATALOGUES;
        } else if (action.equals(ACTION_GET_MY_WORK)) {
            return ACTION_GET_MY_WORK;
        } else if (action.equals(ACTION_GET_MY_WORK_PAD)) {
            return ACTION_GET_MY_WORK_PAD;
        } else if (action.equals(ACTION_SUBMIT_WORKS)) {
            return ACTION_SUBMIT_WORKS;
        } else if (action.equals(ACTION_SUBMIT_ERROR_WORKS)) {
            return ACTION_SUBMIT_ERROR_WORKS;
        } else if (action.equals(ACTION_SUBMIT_VIDEO_WORKS)) {
            return ACTION_SUBMIT_VIDEO_WORKS;
        } else if (action.equals(ACTION_GET_SET_READ)) {
            return ACTION_GET_SET_READ;
        } else if (action.equals(ACTION_GET_CATALOGUE_INFO)) {
            return ACTION_GET_CATALOGUE_INFO;
        } else if (action.equals(ACTION_UPDATE_UNIT_TEST_WORKS)) {
            return ACTION_UPDATE_UNIT_TEST_WORKS;
        } else if (action.equals(ACTION_GET_BOOK_BY_SERVICEID)) {
            return ACTION_GET_BOOK_BY_SERVICEID;
        } else if (action.equals(ACTION_SET_EPAGE_BOOKCASE)) {
            return ACTION_SET_EPAGE_BOOKCASE;
        } else if (action.equals(ACTION_DEL_EPAGE_BOOKCASE)) {
            return ACTION_DEL_EPAGE_BOOKCASE;
        } else if (action.equals(ACTION_DEL_EPAGE_BOOKCASE_LIST)) {
            return ACTION_DEL_EPAGE_BOOKCASE_LIST;
        } else if (action.equals(ACTION_SELECT_EPAGE_BOOKCASE)) {
            return ACTION_SELECT_EPAGE_BOOKCASE;
        } else if (action.equals(ACTION_SELECT_EPAGE_BOOKCASE_ALL)) {
            return ACTION_SELECT_EPAGE_BOOKCASE_ALL;
        } else if (action.equals(ACTION_GET_VIDEO_EXPLAN_ANSWER)) {
            return ACTION_GET_VIDEO_EXPLAN_ANSWER;
        } else if (action.equals(ACTION_GET_ADVERT)) {
            return ACTION_GET_ADVERT;
        } else if (action.equals(ACTION_BOOK_DESK_CATALOGUES)) {
            return ACTION_BOOK_DESK_CATALOGUES;
        } else if (action.equals(ACTION_GET_BOOKCHAPTERS)) {
            return ACTION_GET_BOOKCHAPTERS;
        } else if (action.equals(ACTION_LSW_GET_SCORE_RESULT)) {
            return ACTION_LSW_GET_SCORE_RESULT;
        } else if (action.equals(ACTION_ESSAY_GET_SCORE_RESULT)) {
            return ACTION_ESSAY_GET_SCORE_RESULT;
        } else if (action.equals(ACTION_GET_BOOK_BY_SERVICEID_ANDKEYWORD)) {
            return ACTION_GET_BOOK_BY_SERVICEID_ANDKEYWORD;
        } else if (action.equals(ACTION_GET_ZIP_PACKAGE_LIST)) {
            return ACTION_GET_ZIP_PACKAGE_LIST;
        } else if (action.equals(ACTION_CHECKVALID)) {
            return ACTION_CHECKVALID;
        } else if (action.equals(ACTION_LSW_SUBMIT_WORKS)) {
            return ACTION_LSW_SUBMIT_WORKS;
        } else if (action.equals(ACTION_LSW_RESUBMIT_WORKS)) {
            return ACTION_LSW_RESUBMIT_WORKS;
        } else if (action.equals(ACTION_LSW_SUBMIT_ERROR_WORKS)) {
            return ACTION_LSW_SUBMIT_ERROR_WORKS;
        } else if (action.equals(ACTION_GETEXAM_EXAMINATION)) {
            return ACTION_GETEXAM_EXAMINATION;
        } else if (action.equals(ACTION_USER_SERVICES)) {
            return ACTION_USER_SERVICES;
        } else if (action.equals(GET_USER_PRODUCT_BY_KEY)) {
            return GET_USER_PRODUCT_BY_KEY;
        } else if (action.equals(GET_BOOK_KEY)) {
            return GET_BOOK_KEY;
        } else if (action.equals(ACTION_CATALOGUES_RESOURCE)) {
            return ACTION_CATALOGUES_RESOURCE;
        } else if (action.equals(ACTION_CATALOGUES_RESOURCE_FORMDESK)) {
            return ACTION_CATALOGUES_RESOURCE_FORMDESK;
        } else if (action.equals(ACTION_CATALOGUES_RESOURCE_DICTATION)) {
            return ACTION_CATALOGUES_RESOURCE_DICTATION;
        } else if (action.equals(ACTION_GET_CATALOGUE_INFO_NEW)) {
            return ACTION_GET_CATALOGUE_INFO_NEW;
        } else if (action.equals(ACTION_SEARCH_BOOK_AND_SERVICE)) {
            return ACTION_SEARCH_BOOK_AND_SERVICE;
        } else if (action.equals(ACTION_SEARCH_BOOK_AND_SERVICE_BY_TYPE)) {
            return ACTION_SEARCH_BOOK_AND_SERVICE_BY_TYPE;
        } else if (action.equals(ACTION_GET_SUBJECT_LIST)) {
            return ACTION_GET_SUBJECT_LIST;
        } else if (action.equals(ACTION_GET_AUTONMONIC_STUDY_BOOKS)) {
            return ACTION_GET_AUTONMONIC_STUDY_BOOKS;
        } else if (action.equals(ACTION_GET_ALL_PRODUCTS_BY_BOOKMARK)) {
            return ACTION_GET_ALL_PRODUCTS_BY_BOOKMARK;
        }else if (action.equals(ACTION_GET_ALL_PRODUCTS_BY_GET_INTERACTION_LIST)) {
            return ACTION_GET_ALL_PRODUCTS_BY_GET_INTERACTION_LIST;
        }else if (action.equals(ACTION_GET_TEACHER_GRADE_BY_CATEGORY)) {
            return ACTION_GET_TEACHER_GRADE_BY_CATEGORY;
        } else if (action.equals(ACTION_GET_TEACHER_BY_CATEGORY)) {
            return ACTION_GET_TEACHER_BY_CATEGORY;
        } else if (action.equals(ACTION_GET_STUDENT_PRODUCTS_BY_BOOKMARK)) {
            return ACTION_GET_STUDENT_PRODUCTS_BY_BOOKMARK;
        } else if (action.equals(ACTION_GET_SCORE_OF_ONLINE)) {
            return ACTION_GET_SCORE_OF_ONLINE;
        } else if (action.equals(ACTION_GET_SET_HEAD_LASTBOOKS)) {
            return ACTION_GET_SET_HEAD_LASTBOOKS;
        } else if (action.equals(ACTION_GET_USER_DESK_HEAD)) {
            return ACTION_GET_USER_DESK_HEAD;
        } else if (action.equals(ACTION_GET_MY_GRADE)) {
            return ACTION_GET_MY_GRADE;
        } else if (action.equals(ACTION_GET_SCORE_COEFFICIENT)) {
            return ACTION_GET_SCORE_COEFFICIENT;
        } else if (action.equals(ACTION_GET_EPAGE_ADVISOR)) {
            return ACTION_GET_EPAGE_ADVISOR;
        } else if (action.equals(ACTION_GET_DUBBING_VIDEO_LIST)) {
            return ACTION_GET_DUBBING_VIDEO_LIST;
        } else if (action.equals(ACTION_GET_DUBBING_VIDEO_RECORD_LIST)) {
            return ACTION_GET_DUBBING_VIDEO_RECORD_LIST;
        } else if (action.equals(ACTION_GET_DUBBING_VIDEO_DETAIL)) {
            return ACTION_GET_DUBBING_VIDEO_DETAIL;
        } else if (action.equals(ACTION_LSW_DOWORK_PROGRESS)) {
            return ACTION_LSW_DOWORK_PROGRESS;
        } else if (action.equals(ACTION_GET_MY_ERROR_WORK)) {
            return ACTION_GET_MY_ERROR_WORK;
        } else if (action.equals(ACTION_GET_SYMBOLS_LIST)) {
            return ACTION_GET_SYMBOLS_LIST;
        } else if (action.equals(ACTION_GET_DK_LIST)) {
            return ACTION_GET_DK_LIST;
        } else if (action.equals(ACTION_GET_DK_DETAILS)) {
            return ACTION_GET_DK_DETAILS;
        } else if (action.equals(ACTION_SUBMIT_DK_WORK)) {
            return ACTION_SUBMIT_DK_WORK;
        } else if (action.equals(ACTION_SUBMIT_ESSAY_WORK)) {
            return ACTION_SUBMIT_ESSAY_WORK;
        } else if (action.equals(ACTION_RELATION_SEARCH_SCHOOL)) {
            return ACTION_RELATION_SEARCH_SCHOOL;
        } else if (action.equals(ACTION_RELATION_GET_SCHOOL_LIST)) {
            return ACTION_RELATION_GET_SCHOOL_LIST;
        } else if (action.equals(ACTION_GET_USER_CLASS_WORKS)) {
            return ACTION_GET_USER_CLASS_WORKS;
        } else if (action.equals(ACTION_GET_DUB_VIDEO_RECOMMEND)) {
            return ACTION_GET_DUB_VIDEO_RECOMMEND;
        } else if (action.equals(ACTION_GET_DUB_VIDEO_CID)) {
            return ACTION_GET_DUB_VIDEO_CID;
        } else if (action.equals(ACTION_GET_DUBBING_LIST_BY_NAME)) {
            return ACTION_GET_DUBBING_LIST_BY_NAME;
        } else if (action.equals(ACTION_GET_DUBBINT_LIST_BY_CID)) {
            return ACTION_GET_DUBBINT_LIST_BY_CID;
        } else if (action.equals(ACTION_LSW_UPLOAD_ASYNC_RECORD)) {
            return ACTION_LSW_UPLOAD_ASYNC_RECORD;
        } else if (action.equals(ACTION_GET_TEACHER_GRADE_BY_BOOKMARK)) {
            return ACTION_GET_TEACHER_GRADE_BY_BOOKMARK;
        }else if (action.equals(ACTION_GET_WORD_STOCK_ENGLISH)) {
            return ACTION_GET_WORD_STOCK_ENGLISH;
        }
        return super.getActionUrl(action);
    }


    private static boolean isPad() {
        EApplication eApplication = EApplication.getInstance();
        String packageName = "";
        if (eApplication != null) {
            packageName = eApplication.getPackageName();
        }
        if ("com.ciwong.newspaperhd".equals(packageName)) {
            return true;
        } else {
            return false;
        }
    }
}
